#include "main/utils.h"
using namespace std;

void multiplyVec(vector<int> &a, vector<int> &b) {
  int length_a = a.size();
  int length_b = b.size();
  if (length_a != length_b || length_a < 1)
    return;

  b[0] = 1;
  for (int i = 1; i < length_a; ++i) {
    b[i] = b[i - 1] * a[i - 1];
  }

  int tmp = 1;
  for (int i = length_a - 2; i >= 0; --i) {
    tmp *= a[i + 1];
    b[i] *= tmp;
  }
}

int main() {
  vector<int> a = {1, 2, 3, 4, 5};
  vector<int> b(5, 0);
  multiplyVec(a, b);
  printVec("multiplyVec", b);

  return 0;
}
